-
Notifications
You must be signed in to change notification settings - Fork 1
Add configurable rotation support to landscape view #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds configurable rotation support to landscape visualizations by introducing a rotate parameter that allows users to specify rotation angles in degrees for 2D views.
Key Changes:
- Added
rotatetrait to the Landscape widget API (Python and JavaScript) - Implemented shared rotation utilities with matrix transformations and point rotation functions
- Updated viewport calculations to correctly handle rotated visualizations when fetching tiles and filtering data
Reviewed Changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/celldega/viz/widget.py | Added rotate traitlet to expose rotation angle parameter |
| js/widget.js | Forwarded rotate parameter from model to renderer |
| js/viz/landscape_ist.js | Initialized rotation state with center coordinates and passed to trx_layer |
| js/utils/rotation.js | Created rotation utilities including matrix building and point transformation functions |
| js/deck-gl/layers/trx_layer.js | Applied rotation matrix to transcript layer |
| js/deck-gl/layers/simple_image_layer.js | Applied rotation matrix to simple image layer |
| js/deck-gl/layers/path_layer.js | Applied rotation matrix to path layer |
| js/deck-gl/layers/nbhd_layer.js | Applied rotation matrix to neighborhood layer |
| js/deck-gl/layers/image_layers.js | Applied rotation matrix to image layers |
| js/deck-gl/layers/edit_layer.js | Applied rotation matrix to edit layer |
| js/deck-gl/layers/cell_layer.js | Applied rotation matrix to both PointCloudLayer and ScatterplotLayer variants |
| js/deck-gl/layers/background_layer.js | Applied rotation matrix to background layer |
| js/deck-gl/core/calc_viewport.js | Updated viewport bounds calculation to account for rotation and modified transcript/cell filtering logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I used Codex to implement a rotation argument for the Landscape widget. It works in my testing and the implementation looks ok. I'm gong to use it to rotate a Xenium dataset to match the orientation with a Visium HD dataset. |
huanlity
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I did a test and the rotate=float works on my end. My only complain is that the sample is not centered after rotation, which is fine for now but we will need to get to it eventually (maybe after merging in the scale bar PR).
Summary
Testing
Codex Task